In databases systems, a query may be used to select data from one or more tables of a database. For example, in SQL, the select instruction is used to select the data from the database. The select instruction may be used in conjunction with other instructions, such as a group-by instruction. The group-by instruction is a database instruction that may be used with an aggregation function, such as a sum, an average, and the like, to group the result-set by one or more columns.